package monopoli.gui;


import javax.swing.JDialog;
import monopoli.MonopoliView;
import org.jdesktop.application.FrameView;

/**
 *
 * @author Claudio
 */
public class GestoreRefresh {



    private MonopoliView fv;
    



    GestoreRefresh(FrameView fv) {
        this.fv = (MonopoliView) fv;
    }

    public void refreshDebugConsole(String s) {
        fv.updateDebugConsole(s + "\n");
    }

    public void refreshPlayerConsole(String s) {
        fv.updatePlayerConsole(s + "\n");
        //fv.getFrame().repaint();
    }

    public void appendRefreshPlayerConsole(String s) {
        fv.updateAppendPlayerConsole(s + "\n");
        //fv.getFrame().repaint();
    }


    public void refreshInitializationServerData(String ip, String port) {
        fv.updateInitializationServerTab(ip, port);
    }

    public void refreshHostData(String localHostBindName, String localHostIp, String localHostPort, String nextHostBindName, String nextHostIp, String nextHostPort) {
        fv.updateHostTab(localHostBindName, localHostIp, localHostPort, nextHostBindName, nextHostIp, nextHostPort);
    }

    public void refreshSommario(Sommario s) {
        fv.updatePlayerInformation(s.getNomeGiocatore(),s.getPedina());
        fv.updatePossedimenti(s.getPossedimenti());
        fv.updateSoldi(s.getBanconote());
        fv.updateGiocatori(s.getGiocatori());
}

    void refreshPannello(PannelloDiComando pannello) {
        fv.updateIniziaTurno(pannello.isIniziaTurno());
            fv.updateMessaggioPannello("Procedi!");
        fv.updatePassaTurno(pannello.isPassaTurno());
        if(pannello.isAttesaTurno())
            fv.updateMessaggioPannello("Attesa turno...");


        
        fv.updateDadi(pannello.isDadi());


        fv.updateCasa(pannello.isHouse());
        fv.updateHotel(pannello.isHotel());
        fv.updateAcq(pannello.isAcq());

    }

    void refreshTabellone(Tabellone tab) {
        fv.updateTabellone(tab);
    }

    void mostraSelezioneNome() {
        fv.showRichiediNome();
 }

}
